import org.jsecurity.crypto.hash.Sha1Hash
class BootStrap {

     def init = { servletContext ->
     	if(!User.findByUsername('admin')){
     		def adminRole = new Role(name: "Administrator").save()
     		def adminUser = new User(username: "admin", passwordHash: new Sha1Hash("admin").toHex()).save()
     		new UserRoleRel(user: adminUser, role: adminRole).save()
     	}
     }
     def destroy = {
     }
} 